Batch Files

Batch file examples are located in

C:/Program Files/InternetMacros3/Examples/
Batch Files/

if you used the default installation path.

Command line options: [PRO / SCRIPTING Edition]

For Web professionals, the PRO Edition of Internet Macros can run "stand-alone" with a built-in Web browser. It supports command line options. This PRO version can be called from batch files, from scripting languages or any programming language that supports calling executable with command line options.
Note: Internet Macros works well with the free Windows Task Scheduler. More information on the Windows task scheduler is available on our Web site
.


Command line syntax:

iimpro -macro MACRONAME -var1 <Content !VAR1> -var2 -datasource <filename> ...  

Example: imacros -macro CmdLineTest -var1 Hello[SP]World! (this executes the CmdLineTest macro)
   
After completing the macro, the program automatically stops and closes. Note that in command lines you need to use the square brackets instead of the usual '<>' ones to denote a space [SP] or break [BR] otherwise Windows does not execute this command line correctly.
Internet Macros can be used with standard windows batch files. With batch files you can conveniently execute several Internet Macros in a sequence:



Example batch (*.bat) file:

echo Start Internet Macros batch file 
iimpro -macro FormExampleMacro 
iimpro -macro Check_Altavista 
iimpro -macro Buy_Now! 
echo Done!  

Click here to open a simple example batch file, and here for one that uses the "-var" options.

   
Macro reuse with variables: Internet Macros also support the use of variables: !VAR1, !VAR2 and !VAR3. You can assign values to these variables with the "SET" or the "PROMPT" command.

Example - Use of variables:


PROMPT Enter<SP>variable: !VAR1 http://www.iOpus.com/iim.htm 
SET !VAR2 nobody@nospam.iOpus.com 
TAG TYPE=A ATTR=HREF:http://submit.searchengine.com/ 
TAG TYPE=INPUT:TEXT FORM=NAME:f1 ATTR=NAME:name CONTENT={{!VAR1}} 
TAG TYPE=INPUT:TEXT FORM=NAME:f1 ATTR=NAME:email CONTENT={{!VAR2}}  
TAG TYPE=INPUT:SUBMIT FORM=NAME:f1 ATTR=NAME:btnG CONTENT=  


Real life Example Macro: Submit2Searchengine

NEW with Version 3:
With the new command line switch -var_YOURVARIABLENAME you can create and use more then three built-in variables (up to 100).

Example: "
-var_FIRSTNAME  Frank" will create the variable {{FIRSTNAME}} and fill it with the value "Frank".
   
Tip: If you want Internet Macros to read a value from the command line use the "CMDLINE" command:


Take values from the command line:

CMDLINE !VAR1 http://www.iOpus.com/iim.htm 
SET !VAR2 nobody@nospam.iOpus.com 
TAG TYPE=INPUT:TEXT FORM=NAME:f1 ATTR=NAME:name CONTENT=Tom Tester!VAR1